package mypackage.servicce.Impl;

import mypackage.bean.Comments;
import mypackage.dao.CommentsDao;
import mypackage.dao.impl.CommentsDaoImpl;
import mypackage.servicce.CommentsService;

import java.util.List;

/**
 * @author YH925
 * @create 2021/12/11 14:12
 */
public class CommentsServiceImpl implements CommentsService {
    CommentsDao dao = new CommentsDaoImpl();
    @Override
    public List<Comments> selectByGoodsId(String id) {
        return dao.selectByGoodsId(id);
    }

    @Override
    public void insertCommentsOnTable(String username, int stars, String comments, String goodsId) {
        dao.insertCommentsOnTable(username, stars, comments, goodsId);
    }

    @Override
    public int findAllCommentsByGoodId(String id) {
        return dao.findAllCommentsByGoodId(id);
    }

    @Override
    public int findAllGoodCommentsById(String id) {
        return dao.findAllGoodCommentsById(id);
    }

    @Override
    public int findAllPlainCommentsById(String id) {
        return dao.findAllPlainCommentsById(id);
    }

    @Override
    public int findAllBadCommentsById(String id) {
        return dao.findAllBadCommentsById(id);
    }
}
